<template>
  <div>
    <span v-if="active === 0">
      <PersonalOne @next="next" @setCodeForm="setCodeForm" />
    </span>
    <span v-else>
      <PersonalTwo :code-form="codeForm" @next="next" @last="last" />
    </span>
  </div>
</template>
<script>
import PersonalOne from '@/views/welcome-register/component/PersonalOne'
import PersonalTwo from '@/views/welcome-register/component/PersonalTwo'
export default {
  name: 'PersonalRegister',
  components: {
    PersonalOne,
    PersonalTwo
  },
  data() {
    return {
      active: 0,
      codeForm: {}
    }
  },
  methods: {
    last() {
      if (this.active-- > 2) this.active = 0
    },
    next() {
      if (this.active++ > 1) this.active = 0
    },
    setCodeForm(codeForm) {
      this.codeForm = codeForm
    }
  }
}
</script>
<style scoped lang="scss">

</style>
